<template>
	<!-- 在此组件中 制作一个对话框 -->
	<el-dialog title="新增菜单" :visible.sync="dialogVisible" width="40%">
		<el-form ref="form" label-width="80px" style="padding: 40px; ">
			<el-form-item label="菜单名称">
				<el-input v-model="form.name"></el-input>
			</el-form-item>
			<el-form-item label="菜单地址">
				<el-input v-model="form.url"></el-input>
			</el-form-item>
		</el-form>
		<p slot="footer" class="dialog-footer" style="width: 100%;text-align: center;">
			<el-button @click="dialogVisible = false">取 消</el-button>
			<el-button type="primary" @click="save()">确定</el-button>
		</p>
	</el-dialog>
</template>

<script>
	export default{
		name:"AddRole",
		data() {
			return {
				dialogVisible:false,
				menus:[],
				form:{
					url:"",
					name:"",
				}
			}
		},
		methods: {
			save(){
				this.$http.post("admin/menuCtl/saveMenu",this.form).then((resp)=>{
					console.log(resp.data)
					if(resp.data.code == 200){
						this.$message({
							message: resp.data.message,
							type:'success'
						});
						this.dialogVisible=false;
						//location.reload();
						this.$router.go();
					}
				})
			},
		},
			
	 } 
</script>

<style>
</style>
